﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AssignConfer.aspx.cs" Inherits="H2.NET.Web.Workflow.Workflow.AssignConfer" %>

<%@ Register Assembly="H2.NET.Controls" Namespace="H2.NET.Controls" TagPrefix="H2" %>

<script type="text/javascript">
    
    $(function() {

        initAssignConferOptions();

        $("input:radio[name='actionType']", $.pdialog.getCurrent()).click(function() {
            initAssignConferOptions();
        });

        $("#option", $.pdialog.getCurrent()).change(function() {
            if ($("#option", $.pdialog.getCurrent()).val() == 3) {
                $("#untileDateRow", $.pdialog.getCurrent()).show();
            } else {
                $("#untileDateRow", $.pdialog.getCurrent()).hide();
            }
        });

    });

    function initAssignConferOptions() {
        $("#option", $.pdialog.getCurrent()).empty();
        if (parseInt("<%= CurrentTaskIds.Length %>") > 0) {
            $("#option", $.pdialog.getCurrent()).append("<option value='1'>仅限选择的项目</option>");
        }
        $("#option", $.pdialog.getCurrent()).append("<option value='2'>所有当前的任务</option>");

        if ($('input:radio[name="actionType"]:checked', $.pdialog.getCurrent()).val() == 1) {
            $("#option", $.pdialog.getCurrent()).append("<option value='3'>所有将来的任务</option>");
        }

        $("#option", $.pdialog.getCurrent()).change();
    }

    function winOpenPopup(strURL, str_width, str_height, str_value, str_element, str_postback, str_multiple) {
        alert(strURL);
        var json = window.showModalDialog(
                strURL + "&vt=" + new Date(),
                '',
                "dialogWidth=" + (parseInt(str_width) + 30) + "px;dialogHeight=" + str_height + "px;dialogLeft: status:no; directories:yes;scrollbars:auto;Resizable=yes;");
        
        if (json != null && json != "" && json != undefined) {
            alert(json);
            var obj = eval('(' + json + ')');

            $("#assignConferTo", $.pdialog.getCurrent()).val(obj.a);
            $("#assignConferName", $.pdialog.getCurrent()).val(obj.b);

        } else {
            $("#assignConferTo", $.pdialog.getCurrent()).val("");
            $("#assignConferName", $.pdialog.getCurrent()).val("");
        }
    }       
	

</script>

<div class="pageContent">
	<form runat="server" method="post" action="Workflow/AssignConfer.aspx?action=save" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone, '确定要提交吗？');">
		<div class="pageFormContent" layoutH="50">
			 <table class="formTable">
            <tr>
                <th width="25%">已选项：</th>
                <td width="75%">
                    
                    共选择了<%= CurrentTaskIds.Length %>项
                    <input type="hidden" name="ids" value="<%= string.Join(",", CurrentTaskIds) %>"/>
                </td>
            </tr>
            <tr>
                <th>操作：</th>
                <td>
                    <input type="radio" name="actionType" value="1" checked /> 指派
                    <input type="radio" name="actionType" value="2"/> 会办
                </td>
            </tr>
            <tr>
                <th>操作项：</th>
                <td>
                    <select name="option" id="option" style="width: 150px;"></select>
                </td>
            </tr>
            <tr id="untileDateRow" style="display: none;">
                <th>指定日期到：</th>
                <td>
				    <input type="text" name="untileDate" class="date readonly" readonly size="12">
                    <a class="inputDateButton" href="javascript:;">选择</a>
                </td>
            </tr>
            <tr>
                <th>指派或会办至：</th>
                <td>
                    <input name="assignConferTo" id="assignConferTo" value="" type="hidden"/>
                    <h2:dialog ID="assignConferName" runat="server" ReadOnly CssClass="required" Width="162px" Dialog_ID="SYS-0008"></h2:dialog>
                </td>
            </tr>
        </table>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交申请</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">关闭窗口</button></div></div></li>
			</ul>
		</div>
	</form>
</div>
